import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork" 
// 部门
export const DepartmentInquiry = () => {
    return service.get<any,any>(`/back/deptQuery`)
}

export interface SelectiveInstructionQueryParms{
    lotNo:string,
    mtlName:string,
    mtlSpec:string,
    pageNum:number,
    pageSize:number,
    purNo:string,
    style:string,
    typeNo:string,
    vendorName:string
}

export interface SelectiveInstructionQueryInterface{
    total?:number,
    dtos:dtosList[]
}

interface dtosList{
    lotNo: string,
    seqNo: null,
    partName: null,
    segment: null,
    mtlTypeNo: null,
    mtlType: string,
    mtlNo: string,
    mtlColor: null,
    mtlName: string,
    mtlSpec: string,
    mtlUnit: string,
    ttlUsage: number,
    stkQty: null,
    inQty: number,
    purType: null
}

export const SelectiveInstructionQuery = (parms:SelectiveInstructionQueryParms) => {
    return service.put<any,SelectiveInstructionQueryInterface>('/pcFactorStockQuery/getPackOutLotMtlQuery',parms)
}

// 待入库明细查询
export const QueryDetailsToBeStored = () => {
    return service.get<any,any>('/pcFactorStockQuery/getPackOutTempQuery')
}

// 包材出库明细查询
export const CheckTheDetailsOfPackingMaterialDelivery = (parms:any) => {
    return service.put<any,any>('/pcFactorStockQuery/getPackOutDetQuery',parms)
}

// 待出材料明细删除
export const DetailsToBeReleasedAreDeleted = (item:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/packOutTempDelete?item=${item}`)
}

// 包材材料出库明细删除
export const PackingMaterialDeliveryDetailsDeleted = (item:string,slipNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/packOutDetDelete?item=${item}&slipNo=${slipNo}`)
}

// 材料出库预处理
export const PreTreatmentOfMaterialsOutOfStorage = (parms:any) => {
    return LoginWork.put<any,any>('/pcFactorStockQuery/packOutTempAdd',parms)
}

// 出库批处理新增
export interface OutboundBatchProcessingAddedParms{
    deptName:string,
    deptNo:string,
    item:any,
    mtlNo:string,
    sendNo:string,
    slipDate:string,
    slipReason:string,
    sysDate:string,
    vendorName:string,
    vendorNo:string
}

export const OutboundBatchProcessingAdded = (parms:OutboundBatchProcessingAddedParms) => {
    return LoginWork.put<any,any>('/pcFactorStockQuery/packOutDetAdd',parms)
}